#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'genUnif.ui'
#
# Created: Thu Oct 13 16:09:18 2011
#      by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui
import os, sys
#from genUnif import Ui_GenUnif

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s

class Ui_GenUnif(object):
    def setupUi(self, GenUnif):
        GenUnif.setObjectName(_fromUtf8("GenUnif"))
        GenUnif.resize(331, 211)
        GenUnif.setWindowTitle(QtGui.QApplication.translate("GenUnif", "Generate random uniform vector", None, QtGui.QApplication.UnicodeUTF8))
        self.verticalLayoutWidget = QtGui.QWidget(GenUnif)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 311, 189))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout_2.setMargin(0)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.formLayout_7 = QtGui.QFormLayout()
        self.formLayout_7.setObjectName(_fromUtf8("formLayout_7"))
        self.label_7 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_7.setText(QtGui.QApplication.translate("GenUnif", "Specify size by", None, QtGui.QApplication.UnicodeUTF8))
        self.label_7.setObjectName(_fromUtf8("label_7"))
        self.formLayout_7.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_7)
        self.formLayout_8 = QtGui.QFormLayout()
        self.formLayout_8.setObjectName(_fromUtf8("formLayout_8"))
        self.radioButton = QtGui.QRadioButton(self.verticalLayoutWidget)
        self.radioButton.setText(QtGui.QApplication.translate("GenUnif", "vector of quantiles", None, QtGui.QApplication.UnicodeUTF8))
        self.radioButton.setObjectName(_fromUtf8("radioButton"))
        self.formLayout_8.setWidget(0, QtGui.QFormLayout.LabelRole, self.radioButton)
        self.radioButton_2 = QtGui.QRadioButton(self.verticalLayoutWidget)
        self.radioButton_2.setText(QtGui.QApplication.translate("GenUnif", "vector of probabilites", None, QtGui.QApplication.UnicodeUTF8))
        self.radioButton_2.setObjectName(_fromUtf8("radioButton_2"))
        self.formLayout_8.setWidget(1, QtGui.QFormLayout.LabelRole, self.radioButton_2)
        self.radioButton_3 = QtGui.QRadioButton(self.verticalLayoutWidget)
        self.radioButton_3.setText(QtGui.QApplication.translate("GenUnif", "number of observations", None, QtGui.QApplication.UnicodeUTF8))
        self.radioButton_3.setObjectName(_fromUtf8("radioButton_3"))
        self.formLayout_8.setWidget(2, QtGui.QFormLayout.LabelRole, self.radioButton_3)
        self.spinBox = QtGui.QSpinBox(self.verticalLayoutWidget)
        self.spinBox.setEnabled(False)
        self.spinBox.setMaximum(2048)
        self.spinBox.setProperty("value", 1)
        self.spinBox.setObjectName(_fromUtf8("spinBox"))
        self.formLayout_8.setWidget(2, QtGui.QFormLayout.FieldRole, self.spinBox)
        self.lineEdit = QtGui.QLineEdit(self.verticalLayoutWidget)
        self.lineEdit.setEnabled(False)
        self.lineEdit.setToolTip(QtGui.QApplication.translate("GenUnif", "Type in the name of an existing vector, and any conditions you may want to place on it", None, QtGui.QApplication.UnicodeUTF8))
        self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
        self.formLayout_8.setWidget(0, QtGui.QFormLayout.FieldRole, self.lineEdit)
        self.lineEdit_2 = QtGui.QLineEdit(self.verticalLayoutWidget)
        self.lineEdit_2.setEnabled(False)
        self.lineEdit_2.setToolTip(QtGui.QApplication.translate("GenUnif", "Type in the name of an existing vector, and any conditions you may want to place on it", None, QtGui.QApplication.UnicodeUTF8))
        self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
        self.formLayout_8.setWidget(1, QtGui.QFormLayout.FieldRole, self.lineEdit_2)
        self.formLayout_7.setLayout(1, QtGui.QFormLayout.FieldRole, self.formLayout_8)
        self.label = QtGui.QLabel(self.verticalLayoutWidget)
        self.label.setText(QtGui.QApplication.translate("GenUnif", "new vector name:", None, QtGui.QApplication.UnicodeUTF8))
        self.label.setObjectName(_fromUtf8("label"))
        self.formLayout_7.setWidget(0, QtGui.QFormLayout.LabelRole, self.label)
        self.vname = QtGui.QLineEdit(self.verticalLayoutWidget)
        self.vname.setText(_fromUtf8(""))
        self.vname.setPlaceholderText(QtGui.QApplication.translate("GenUnif", "x", None, QtGui.QApplication.UnicodeUTF8))
        self.vname.setObjectName(_fromUtf8("vname"))
        self.formLayout_7.setWidget(0, QtGui.QFormLayout.FieldRole, self.vname)
        self.verticalLayout_2.addLayout(self.formLayout_7)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.formLayout_5 = QtGui.QFormLayout()
        self.formLayout_5.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout_5.setObjectName(_fromUtf8("formLayout_5"))
        self.label_5 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_5.setText(QtGui.QApplication.translate("GenUnif", "Minimum", None, QtGui.QApplication.UnicodeUTF8))
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.formLayout_5.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_5)
        self.Min = QtGui.QDoubleSpinBox(self.verticalLayoutWidget)
        self.Min.setMinimum(-1000000000.0)
        self.Min.setMaximum(1000000000.0)
        self.Min.setObjectName(_fromUtf8("Min"))
        self.formLayout_5.setWidget(0, QtGui.QFormLayout.FieldRole, self.Min)
        self.Max = QtGui.QDoubleSpinBox(self.verticalLayoutWidget)
        self.Max.setMinimum(-1000000000.0)
        self.Max.setMaximum(1000000000.0)
        self.Max.setProperty("value", 1.0)
        self.Max.setObjectName(_fromUtf8("Max"))
        self.formLayout_5.setWidget(1, QtGui.QFormLayout.FieldRole, self.Max)
        self.label_6 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_6.setText(QtGui.QApplication.translate("GenUnif", "Máximum", None, QtGui.QApplication.UnicodeUTF8))
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.formLayout_5.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_6)
        self.horizontalLayout_2.addLayout(self.formLayout_5)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.checkBox_2 = QtGui.QCheckBox(self.verticalLayoutWidget)
        self.checkBox_2.setEnabled(False)
        self.checkBox_2.setToolTip(QtGui.QApplication.translate("GenUnif", "If checked, probabilities p are given as log(p)", None, QtGui.QApplication.UnicodeUTF8))
        self.checkBox_2.setText(QtGui.QApplication.translate("GenUnif", "log(p)", None, QtGui.QApplication.UnicodeUTF8))
        self.checkBox_2.setObjectName(_fromUtf8("checkBox_2"))
        self.verticalLayout.addWidget(self.checkBox_2)
        self.checkBox = QtGui.QCheckBox(self.verticalLayoutWidget)
        self.checkBox.setEnabled(False)
        self.checkBox.setToolTip(QtGui.QApplication.translate("GenUnif", "If checked, probabilities are P[X ≤ x], otherwise, P[X > x]", None, QtGui.QApplication.UnicodeUTF8))
        self.checkBox.setText(QtGui.QApplication.translate("GenUnif", "Lower tail", None, QtGui.QApplication.UnicodeUTF8))
        self.checkBox.setObjectName(_fromUtf8("checkBox"))
        self.verticalLayout.addWidget(self.checkBox)
        self.horizontalLayout_2.addLayout(self.verticalLayout)
        self.verticalLayout_2.addLayout(self.horizontalLayout_2)
        self.buttonBox = QtGui.QDialogButtonBox(self.verticalLayoutWidget)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.verticalLayout_2.addWidget(self.buttonBox)
        self.label.setBuddy(self.vname)
        self.label_5.setBuddy(self.Min)
        self.label_6.setBuddy(self.Max)

        self.retranslateUi(GenUnif)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), GenUnif.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), GenUnif.reject)
        QtCore.QObject.connect(self.radioButton, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.checkBox_2.setEnabled)
        QtCore.QObject.connect(self.radioButton_2, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.checkBox_2.setEnabled)
        QtCore.QObject.connect(self.radioButton, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), self.checkBox.setEnabled)
        QtCore.QObject.connect(self.radioButton_2, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.checkBox.setEnabled)
        QtCore.QObject.connect(self.radioButton_3, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.spinBox.setEnabled)
        QtCore.QObject.connect(self.radioButton, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.lineEdit.setEnabled)
        QtCore.QObject.connect(self.radioButton_2, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.lineEdit_2.setEnabled)
        QtCore.QMetaObject.connectSlotsByName(GenUnif)

    def retranslateUi(self, GenUnif):
        pass

# Create a class for our main window
 class Main(QtGui.QMainWindow):
     def __init__(self):
         QtGui.QMainWindow.__init__(self)

         # This is always the same
         self.ui=Ui_GenUnif()
         self.ui.setupUi(self)

 def main():
     # Again, this is boilerplate, it's going to be the same on
     # almost every app you write
     app = QtGui.QApplication(sys.argv)
     window=Main()
     window.show()
     # It's exec_ because exec is a reserved word in Python
     sys.exit(app.exec_())


 if __name__ == "__main__":
     main()